<?php
$this->breadcrumbs=array(
	UserModule::t('Users')=>array('/user'),
	UserModule::t('Manage'),
);

$this->menu=array(
    array('label'=>UserModule::t('Create User'), 'url'=>array('create')),
    array('label'=>UserModule::t('Manage Users'), 'url'=>array('admin')),
    array('label'=>UserModule::t('Manage Profile Field'), 'url'=>array('profileField/admin')),
    array('label'=>UserModule::t('List User'), 'url'=>array('/user')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
    $('.search-form').toggle();
    return false;
});	
$('.search-form form').submit(function(){
    $.fn.yiiGridView.update('user-grid', {
        data: $(this).serialize()
    });
    return false;
});
");

?>
<h1>Kelola User</h1>
<a href="<?php echo Yii::app()->createUrl('user/Admin/create'); ?>" class="btn btn-sm btn-primary">Tambah</a><br /><br />



<?php $this->widget('bootstrap.widgets.TbGridView',array(
	'id'=>'user-grid',
	'dataProvider'=>$model->search(),
	//'filter'=>$model,
	'columns'=>array(
		array(
			'name' => 'id',
			'type'=>'raw',
			'value' => 'CHtml::link(CHtml::encode($data->id),array("admin/update","id"=>$data->id))',
		),
		array(
			'name' => 'level',
			'value' => 'MstTypeContent::model()->findByPk($data->level)->name',
		),
		array(
			'name' => 'username',
			'type'=>'raw',
			'value' => 'CHtml::link(UHtml::markSearch($data,"username"),array("admin/view","id"=>$data->id))',
		),
		'nama',
		'inisial',
		'email',
		array(
                'class'=>'bootstrap.widgets.TBButtonColumn',
               'template' => '{view}{update}{delete}',
               'buttons' => array(
               				'view' => array(
								'options'=>array(
								'class'=>'btn btn-small view'
								)
                            ),

               				'update' => array(
								'options'=>array(
								'class'=>'btn btn-small update'
								)
                            ),


                            'delete' => array(
                              'options'=>array(
                                   'class'=>'btn btn-small delete'
                                   ),
                            ),

               ),
            'htmlOptions'=>array('style'=>'width: 150px'),
           )
	),
)); ?>
